﻿using T4UtilityBelt.UxDesigns.Controls.Renderers.Windows;
using T4UtilityBelt.Writers;

namespace T4UtilityBelt.UxDesigns.Specialized.Renderers.WindowsPhone
{
    public class HeaderRenderer : ControlRenderer<Header, IHeaderRenderer>, IHeaderRenderer
    {

        // <tcl:BindableApplicationBarIconButton IconUri="/images/appbar.save.rest.png" Text="Save" tcl:AppBarItemClick.Command="{Binding SaveCommand}" />

        protected override void OnRenderUiXmlBegin(Header control, CodeWriter writer)
        {
            writer.WriteBeginTag("phone:PivotItem");
            writer.AddBinding("Header", control.Text);
            writer.WriteEnd();
        }

        protected override void OnRenderUiXmlContent(Header control, CodeWriter writer)
        {
            //control.Controls.RenderUiXml(writer);
        }

        protected override void OnRenderUiXmlEnd(Header control, CodeWriter writer)
        {
            writer.WriteEndTag("phone:PivotItem");
        }
    }
}